'use client';
import { changeOpen } from "@/store/home/homeSlice";
import { useAppDispatch } from "@/store/hooks";
import { CDN } from "@/utils/env";
import { useRef } from "react";

export default function Content(){
    const timer = useRef<NodeJS.Timeout | null>(null)
    const dispatch = useAppDispatch()
    return <div className="flex flex-col justify-center items-center mt-[20px] lg:items-start lg:mr-[15px]">
        <img src={`${CDN}images/logo.svg`} className="size-[72px]" />
        <div className="text-white text-[30px] font-[900] my-[10px] lg:text-[64px]">Diamond Galaxy</div>
        <img className="w-[198px] active:scale-95" src={`${CDN}images/google.png`} onClick={() => {
            if(!timer.current){
                dispatch(changeOpen(true))
                timer.current = setTimeout(() => {
                    dispatch(changeOpen(false))
                    timer.current = null
                }, 3000)
            }
        }} />
    </div>
}